﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.IO;
using SfcorpDLL.biz;
using SfcorpDLL.ety;

namespace Sfcorp.form
{
    public partial class frmAgyBnsTD : DevExpress.XtraEditors.XtraForm
    {
        IList<etyFrtAgyBns> bnsList;
        bizAgyBns bzAgyBns;
        public frmAgyBnsTD(IList<etyFrtAgyBns> bnsList)
        {
            InitializeComponent();
            this.bnsList = bnsList;
        }

        private void frmBnsBlNo_Load(object sender, EventArgs e)
        {
            bzAgyBns = new bizAgyBns(global.basSysPara);

            ggcBnsList.GridView = this.gridView1;
            ggcBnsList.GridView.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;
            string sGridHead = "[CONTRACT_NO;业务单号],[CONTRACT_DATE;业务单日期],[CUSTOMER_NAM;客户名称],[PORT_NAM;码头名称],[FEE_WAY_NAM;结算方式],[SEA_BILL_NO;海运提单号],[CNTR;柜号],[REC_NAM;办理人],[CUSTOMER_ID;客户代码],[FEE_WAY_ID;结算方式],[CLIENT_ID;办单人],[CLIENT_CONTACT;联系方式],[PORT_ID;码头代码],"
                         + "[I_E_ID;进出口],[I_E_NAM;进出口],[COLLABORATE_ID;合作方],[COLLABORATE_NAM;合作方名称],[CNTR_CORP_COD;货代],[CNTR_CORP_NAM;货代名称],"
                         + "[AGENT_BILL_NO;货代提单号],[BOOKING_NO;SO送单号],[WORK_WAY_ID;作业方式],[WORK_WAY_NAM;作业方式],[CNTR_SIZ_COD;尺寸],[CNTR_TYP_COD;类型],[CARGO_COD;货物代码],[CARGO_NAM;货物名称],"
                         + "[FLOW_COD;流向港口],[SHIP_NAM;船名],[VOYAGE;航次],[UNDG_NO;国际危规号],[WEIGHING;是否过磅],[CNTR_CTRL_COD;控箱],[CNTR_OPER_COD;箱属],[FOREIGN_VVD;内外贸标识],[FOREIGN_VVD_DESC;内外贸],[BNS_SPC_MOD;特别处理],[BNS_SPC_MOD_DESC;特别处理]";
            ggcBnsList.ColumnsMappingCreate(sGridHead);
             
            srcBinding.DataSource = bnsList;
            ggcBnsList.DataSource = srcBinding;
            ggcBnsList.AutoColumnWidth();
        }

        private void btYes_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void btNo_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.No;
            this.Close();
        }
    }
}